from functools import wraps
from flask import request, abort

def require_api_key(api_key):
    def decorator(f):
        @wraps(f)
        def decorated_function(*args, **kwargs):
            if request.args.get('key') != api_key:
                abort(403)
            return f(*args, **kwargs)
        return decorated_function
    return decorator
